<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
    <title>${title.encodeAsHtml()}</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link rel="stylesheet" href="${resourcesPath}/css/main.css" type="text/css" media="screen, print" title="Style" charset="utf-8" />
    <link rel="stylesheet" href="${resourcesPath}/css/custom.css" type="text/css" media="screen, print" title="Style" charset="utf-8" />
    <link rel="stylesheet" href="${resourcesPath}/css/pdf.css" type="text/css" media="print" title="PDF" charset="utf-8" />
    <script src="${resourcesPath}/js/docs.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/1.5.13/clipboard.min.js"></script>
    <script type="text/javascript">
        function addJsClass(el) {
            var classes = document.body.className.split(" ");
            classes.push("js");
            document.body.className = classes.join(" ");
        }
    </script>
</head>

<body class="body" onload="addJsClass();">
<div id="navigation">
    <div class="navTitle">
        <span id="logo"><a href="http://micronaut.io" title="Go to Micronaut Website"><img src="${resourcesPath}/img/micronaut-logo-white.svg" alt="Micronaut"/></a></span>
    </div>
    <div class="navLinks">
        <ul>
            <li>
                <div id="nav-summary" onmouseover="toggleNavSummary(false)" onmouseout="toggleNavSummary(true)">
                    <a href="${path}/guide/index.html" class="button">Table of contents</a>
                    <div id="nav-summary-childs" style="display:none;">
                        <%
                        toc.children.eachWithIndex { ch, i ->
                        if (single) {
                        %>
                        <div class="toc-item" style="margin-left:0"><a href="#${ ch.name.encodeAsUrlFragment().encodeAsHtml() }"><strong>${i + 1}</strong><span>${ch.title?.encodeAsHtml()}</span></a></div>
                        <%
                        }
                        else {
                        %>
                        <div class="toc-item" style="margin-left:0"><a href="${path}/guide/${ch.name.encodeAsUrlPath().encodeAsHtml()}.html"><strong>${i + 1}</strong><span>${ch.title?.encodeAsHtml()}</span></a></div>
                        <%
                        }
                        }
                        %>
                    </div>
                </div>
            </li>
            <li>
                <a href="${path}/api/index.html" class="button">API Reference</a>
            </li>
        </ul>

    </div>
</div>


<% if(toc){ %>
<div id="table-of-content" class="desktop">
    <h2><abbr title="Table of Contents">ToC</abbr></h2>
    <%
    sectionWriter = { lvl, section, topSection, prefix ->
    if (single) {
    %>
    <div class="toc-item" style="margin-left:${lvl * 10}px"><a href="#${ section.name.encodeAsUrlFragment().encodeAsHtml() }"><strong>$prefix</strong><span>${section.title?.encodeAsHtml()}</span></a></div>
    <%
    }
    else {
    %>
    <div class="toc-item" style="margin-left:${lvl * 10}px"><a href="${path}/guide/${topSection.name.encodeAsUrlPath().encodeAsHtml()}.html${ lvl == 0 ? '' : '#' + section.name.encodeAsUrlFragment().encodeAsHtml() }"><strong>$prefix</strong><span>${section.title?.encodeAsHtml()}</span></a></div>
    <%
    }

    lvl++
    section.children.eachWithIndex { s, j ->
    sectionWriter.call(lvl, s, topSection, prefix + '.' + (j + 1))
    }
    }

    toc.children.eachWithIndex { topSection, i ->
    sectionWriter.call(0, topSection, topSection, i + 1)
    }
    %>
    <div style="clear:both" ></div>
</div>
<% } %>
            <div id="main" class="corner-all">
                <div class="project">
                    <h1>${title.encodeAsHtml()}</h1>
                    <p></p>
                    <p>${subtitle?.encodeAsHtml()}</p>
                    <p><strong>Version:</strong> ${version}</p>
                </div>
                ${content}
            </div>


<div id="footer">
    ${copyright}
    ${footer}
</div>


<script type="text/javascript">
    var prevScrollpos = window.pageYOffset;
    window.onscroll = function() {
        var currentScrollPos = window.pageYOffset;
        var show = false;
        if ((prevScrollpos > currentScrollPos) || (currentScrollPos < 5)) {
            show = true;
        }
        if (show) {
            document.getElementById("navigation").style.top = "0";
        } else {
            document.getElementById("navigation").style.top = "-76px";
        }
        prevScrollpos = currentScrollPos;
    }
</script>
</body>
</html>